package org.sixtythousand.joker;

import org.sixtythousand.joker.util.Callback;

import java.util.concurrent.Callable;

/**
 * 负责I/O通信的抽象通道
 * @author zhoulk
 * @date 2023/10/11 10:52
 * @desc
 */
public interface JChannel {

    Runnable onRead(Object data);

    void setConnection(Connection connection);

    Callback readCallback();

    void addReadCallback(Callback readCallback);

    Connection getConnection();

    void writeAndFlush(Object data);
}
